import 'package:finance_app/src/entities/purchases_summary_entity.dart';

purchasesSummaryEntityFromJson(PurchasesSummaryEntity data, Map<String, dynamic> json) {
	if (json['open_purchase_order'] != null) {
		data.openPurchaseOrder = json['open_purchase_order'].toString();
	}
	if (json['unpaid_bill'] != null) {
		data.unpaidBill = json['unpaid_bill'].toString();
	}
	if (json['overdue_bill'] != null) {
		data.overdueBill = json['overdue_bill'].toString();
	}
	if (json['billed_purchase_order'] != null) {
		data.billedPurchaseOrder = json['billed_purchase_order'].toString();
	}
	if (json['closed_purchase_order'] != null) {
		data.closedPurchaseOrder = json['closed_purchase_order'].toString();
	}
	if (json['paid_bill'] != null) {
		data.paidBill = json['paid_bill'].toString();
	}
	if (json['unpaid_expense'] != null) {
		data.unpaidExpense = json['unpaid_expense'].toString();
	}
	if (json['overdue_expense'] != null) {
		data.overdueExpense = json['overdue_expense'].toString();
	}
	if (json['paid_expense'] != null) {
		data.paidExpense = json['paid_expense'].toString();
	}
	return data;
}

Map<String, dynamic> purchasesSummaryEntityToJson(PurchasesSummaryEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['open_purchase_order'] = entity.openPurchaseOrder;
	data['unpaid_bill'] = entity.unpaidBill;
	data['overdue_bill'] = entity.overdueBill;
	data['billed_purchase_order'] = entity.billedPurchaseOrder;
	data['closed_purchase_order'] = entity.closedPurchaseOrder;
	data['paid_bill'] = entity.paidBill;
	data['unpaid_expense'] = entity.unpaidExpense;
	data['overdue_expense'] = entity.overdueExpense;
	data['paid_expense'] = entity.paidExpense;
	return data;
}